import request from '@/request/request'

// 获取收入单列表
export function getIncomeBillList(params) {
  return request({
    url: '/finance/incomeBill/list',
    method: 'get',
    params
  })
}

// 获取收入单详情
export function getIncomeBillDetail(id) {
  return request({
    url: `/finance/incomeBill/detail/${id}`,
    method: 'get'
  })
}

// 新增收入单
export function addIncomeBill(data) {
  return request({
    url: '/finance/incomeBill/add',
    method: 'post',
    data
  })
}

// 修改收入单
export function updateIncomeBill(data) {
  return request({
    url: '/finance/incomeBill/update',
    method: 'put',
    data
  })
}

// 删除收入单
export function deleteIncomeBill(id) {
  return request({
    url: `/finance/incomeBill/delete/${id}`,
    method: 'delete'
  })
}

// 批量删除收入单
export function batchDeleteIncomeBill(ids) {
  return request({
    url: '/finance/incomeBill/batchDelete',
    method: 'delete',
    data: ids
  })
}

// 审核收入单
export function approveIncomeBill(id) {
  return request({
    url: `/finance/incomeBill/approve/${id}`,
    method: 'put'
  })
}

// 批量审核收入单
export function batchApproveIncomeBill(ids) {
  return request({
    url: '/finance/incomeBill/batchApprove',
    method: 'put',
    data: ids
  })
}

// 导出收入单
export function exportIncomeBill(params) {
  return request({
    url: '/finance/incomeBill/export',
    method: 'get',
    params
  })
}

// 获取收入单统计
export function getIncomeBillStats(params) {
  return request({
    url: '/finance/incomeBill/stats',
    method: 'get',
    params
  })
} 